import { get } from 'lodash-es'
import router from '@/router'
export const getQueryParam = (param: string | string[], defaultVal = '') => {
  const query = router.currentRoute.value?.query ?? {}
  const val = get(query, param) ?? defaultVal
  return decodeURIComponent(val)
}

export const getImageUrl = (name: string) => {
  // console.log(new URL('@/assets/images/scale.png', import.meta.url).href)
  return new URL(`../assets/images/${name}`, import.meta.url).href
}
